package hn.cch.security.repository;


import hn.cch.security.entity.User;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;
import org.springframework.stereotype.Repository;

/**
 * @author CCH
 * @version 2018.07.02
 */

@Repository
public interface UserRepository extends JpaRepository<User, Long> {

    @Query("select u from User u where u.name like :name")
    Page<User> findPageByName(@Param("name") String name, Pageable pageable);

    User findByUsername(String username);
}
